package com.woniu.service.impl;

import com.woniu.dao.RoleDAO;
import com.woniu.pojo.Role;
import com.woniu.service.RoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class RoleServiceImpl implements RoleService {
    @Autowired
    private RoleDAO roleDAO;
    @Override
    public List findRoles() {
        return roleDAO.queryRoles();
    }

    @Override
    public List<Role> findRolesByPage(Integer currentPage, Integer pageSize, String roleName) {
        return roleDAO.queryRolesByPage(currentPage,pageSize,roleName);
    }

    @Override
    public String findAuthIdsByRoleId(Integer roleId) {
        return roleDAO.queryAuthIdsByRoleId(roleId);
    }

    @Override
    public void updateRoleAuthIds(String authIds, Integer roleId) {
        roleDAO.updateRoleAuthIds(authIds,roleId);
    }
}
